﻿using Core.IService;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Core.WebApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class TestController : ControllerBase
    {
        public ISysOrgService orgService { get; set; }
        public TestController(ISysOrgService orgService)
        {
            this.orgService = orgService;
        }

        [HttpGet]
        [Route("index")]
        public IActionResult Test()
        {
            var rst = orgService.GetList().Select(r => new { r.Name, r.Tel });
            return Ok(rst);
        }
    }
}
